import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import home from '@/components/home'
import main from '@/components/main'
import order from '@/components/order'
import user from '@/components/user'
import detail from'@/components/detail'
import cinema from'@/components/cinema'
import seat from'@/components/seat'
import login from'@/components/login'
import reg from'@/components/reg'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
    	path:'/home',
    	redirect:"/home/main",
    	name:'home',
    	component:home,
    	children:[
    	   {path:'main',component:main},
    	   {path:'order',component:order},
    	   {path:'user',component:user}
    	]
    },
    {
    	path:'/detail',
    	name:'detail',
    	component:detail
    },
    {
    	path:'/cinema',
    	name:'cinema',
    	component:cinema
    },
    {
    	path:'/seat',
    	name:'seat',
    	component:seat
    },
     {
    	path:'/login',
    	name:'login',
    	component:login
    },
    {
    	path:'/reg',
    	name:'reg',
    	component:reg
    },
    {
    	path:'*',
    	redirect:"home"
    }
  ]
})
